Skip to content

Fix DisposalUnit deletes enitites that climbing inside in special timing#43686

Open
M4rchy-S wants to merge 1 commit intospace-wizards:masterfrom
M4rchy-S:dis-unit
Open

Fix DisposalUnit deletes enitites that climbing inside in special timing#43686
M4rchy-S wants to merge 1 commit intospace-wizards:masterfrom
M4rchy-S:dis-unit

Conversation

@M4rchy-S
Copy link
Copy Markdown
Contributor

About the PR

Closes: #43541

Why / Balance

Critical bug.

Technical details

Bug occurs because of race conditions between OnDestruction and OnDoAfter functions.
Added special flag in component to detect disposal unit deletion.

Requirements

Breaking changes

Changelog

🆑

  • fix: players could be deleted if a disposal unit was destroyed while they were climbing inside in special timing.

@PJBot PJBot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/XS Denotes a PR that changes 0-9 lines. labels Apr 22, 2026
@M4rchy-S M4rchy-S changed the title Fix disposalUnit deletes Entity because race condition on destroyed e… Fix DisposalUnit deletes enitites that climbing inside in special timing Apr 22, 2026
private void OnDoAfter(EntityUid uid, DisposalUnitComponent component, DoAfterEvent args)
{
if (args.Handled || args.Cancelled || args.Args.Target == null || args.Args.Used == null)
if (args.Handled || args.Cancelled || args.Args.Target == null || args.Args.Used == null || component.IsDestroyed)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would TerminatingOrDeleted work instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked TerminatingOrDeleted and it does not work.

@Pok27 Pok27 added T: Bugfix Type: Bugs and/or bugfixes P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. D3: Low Difficulty: Some codebase knowledge required. A: General Interactions Area: General in-game interactions that don't relate to another area. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: General Interactions Area: General in-game interactions that don't relate to another area. D3: Low Difficulty: Some codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/XS Denotes a PR that changes 0-9 lines. T: Bugfix Type: Bugs and/or bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Entering disposal unit at exact same time it is destroyed deletes you

4 participants